package com.hcloud.libupload.excetion;

public class UploadError extends Throwable {

    //http 状态码
    //200 请求成功
    //201 上传分片成功
    //400 参数错误
    //401 用户校验错误
    //405 http method不支持
    //495 云盘过期
    //496 云盘空间不足
    //497 上传分片数据不完整
    //498 未绑定云盘
    //500 服务器错误

    //返回json 状态码
    //0000 成功
    //1001 失败
    //1002 参数错误
    //1003 未登录
    //9999 内部错误
    //2001 空间不足

    //上传文件的filepath处理文件错误
    public static final String UPLOAD_ERROR_10000 = "10000";
    //创建upload id 错误
    public static final String UPLOAD_ERROR_10001 = "10001";
    //获得分片数错误
    public static final String UPLOAD_ERROR_10002 = "10002";
    //上传文件错误
    public static final String UPLOAD_ERROR_10003 = "10003";
    //上传完成 合并上传文件错误
    public static final String UPLOAD_ERROR_10004 = "10004";
    //手动点击暂停 上传失败
    public static final String UPLOAD_ERROR_10005 = "10005";

    //系统错误
    public static final String UPLOAD_ERROR_10006 = "10006";

    //token错误
    public static final String UPLOAD_ERROR_10007 = "10007";
    //phone错误
    public static final String UPLOAD_ERROR_10008 = "10008";

    //快传错误
    public static final String UPLOAD_ERROR_10009 = "10009";

    public static final String HTTP_ERROR_200 = "200";
    public static final String HTTP_ERROR_201 = "201";
    public static final String HTTP_ERROR_400 = "400";
    public static final String HTTP_ERROR_401 = "401";
    public static final String HTTP_ERROR_405 = "405";
    public static final String HTTP_ERROR_495 = "495";
    public static final String HTTP_ERROR_496 = "496";
    public static final String HTTP_ERROR_497 = "497";
    public static final String HTTP_ERROR_498 = "498";
    public static final String HTTP_ERROR_500 = "500";

    public static final String UPLOAD_ERROR_0000 = "0000";
    public static final String UPLOAD_ERROR_1001 = "1001";
    public static final String UPLOAD_ERROR_1002 = "1002";
    public static final String UPLOAD_ERROR_1003 = "1003";
    public static final String UPLOAD_ERROR_9999 = "9999";
    public static final String UPLOAD_ERROR_2001 = "2001";

    private String errorCode = "";
    private String errorMsg;

    public UploadError(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMsg = errorMsg;


    }

    public String getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }

    @Override
    public String toString() {
        return "ServerError{" +
                "errorCode='" + errorCode + '\'' +
                ", errorMsg='" + errorMsg + '\'' +
                '}';
    }
}
